#include<stdio.h>
#include<string.h>
int count(char s[]){
	int a=0,b=0,c=0,d=0;
	int len=strlen(s);
	for(int i=0;i<len;i++){
		if((s[i]>='a'&&s[i]<='z')||(s[i]>='A'&&s[i]<='Z')){
			a++;
		}
		else if(s[i]==' '||s[i]=='\n'){
			b++;
		}
		else if(s[i]>='0'&&s[i]<='9'){
			c++;
		}
		else{
			d++;
		}
	}
	printf("letter=%d,blank=%d,digit=%d,other=%d",a,b,c,d);
}
int main(){
	char s[100];
	for(int i=0;i<100;i++){
		scanf("%c",&s[i]);
		if(s[i]=='#')
		break;
	}
	count(s);
	return 0;
}
